package com.abvnet.project.water.api.web;

import com.abvnet.framework.web.controller.BaseController;
import com.abvnet.framework.web.domain.AjaxResult;
import com.abvnet.project.water.sewage.service.ISewagePlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/sewage/plan")
public class ApiSewagePlanController extends BaseController {

    @Autowired
    private ISewagePlanService sewagePlanService;

    @GetMapping("/list")
    public AjaxResult list() {
        return AjaxResult.success(sewagePlanService.selectSewagePlanListForApi(null));
    }

    @GetMapping("/get")
    public AjaxResult get(@RequestParam("planId") Long planId) {
        return AjaxResult.success(sewagePlanService.selectSewagePlanForApi(planId));
    }
}
